import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import {renderIcon} from "@/utils";
import {OptionsSharp} from "@vicons/ionicons5";

const routes: Array<RouteRecordRaw> = [
  {
    path: '/warehouse',
    name: 'Warehouse',
    redirect: '/warehouse/offline_repos',
    component: Layout,
    meta: {
      icon: renderIcon(OptionsSharp),
      title: 'AI仓库',
      orderNo: 2,
      roles: ['admin', 'user']
    },
    children: [
      {
        path: 'offline_repos',
        name: 'OfflineRepos',
        meta: {
          title: '离线仓库',
          permissions: ['offline_repos'],
          icon: renderIcon(OptionsSharp),
        },
        component: () => import('@/views/warehouse/offline_repos/Index.vue'),
      },
      {
        path: 'app_repos',
        name: 'AppRepos',
        meta: {
          title: '应用仓库',
          // permissions: ['app_repos'],
          icon: renderIcon(OptionsSharp),
        },
        component: () => import('@/views/warehouse/app_repos/Index.vue'),
      },
    ],
  }
];

export default routes;
